<html>
<#include "../common/header.ftl">


<body>
<div id="wrapper" class="toggled">

<#--边栏sidebar-->
    <#include "../common/nav.ftl">

<#--主要内容content-->
    <div id="page-content-wrapper">
        <div class="seach-term">
            <div class="row seach-info">
                <form role="form" method="get"  id="sendForm"  >

                  <input type="hidden" name="type" value="${(queryOrderDTO.type)!''}">
                <div class="form-group col-xs-6 col-sm-3 ">
                    <label for="mobile" class="col-xs-6 col-sm-3 control-label ">下单时间：</label>
                    <div class="col-xs-6 col-sm-8">
                        <input class="form-control order-time" id="startTime" type="text" name="createTime" value="${(queryOrderDTO.createTime)!''}" placeholder="请选择下单时间" readonly>
                    </div>
                </div>
                <div class="form-group col-xs-6 col-sm-3 ">
                    <label for="mobile" class="col-xs-6 col-sm-3 control-label ">联系方式：</label>
                    <div class="col-xs-6 col-sm-8">
                        <input type="text" class="form-control" id="mobile"  value="${(queryOrderDTO.phone)!''}"  name="phone" placeholder="请输入电话号码">
                    </div>
                </div>

                <div class="form-group col-xs-6 col-sm-2">
                    <label  class="col-xs-6 col-sm-4 control-label">取件点：</label>
                    <div class="col-xs-6 col-sm-8  down-choice">
                        <select id="choiceState" name="pickUpParts">
                            <option value="-1">请选择</option>
                            <#list pointList as point>
                                <option value="${point.categoryId}"
                                    <#if (queryOrderDTO.pickUpParts)?? && queryOrderDTO.pickUpParts == point.categoryId>
                                        selected
                                    </#if>
                                >${point.categoryName}
                                </option>
                            </#list>
                        </select>
                    </div>
                </div>
                <div class="form-group col-xs-6 col-sm-2">
                    <label  class="col-xs-6 col-sm-4 control-label">规格：</label>
                    <div class="col-xs-6 col-sm-8  down-choice">
                        <select id="choiceState" name="specId">
                            <option value="-1">请选择</option>
                            <#list specList as spec>
                                <option value="${spec.categoryId}"
                                    <#if (queryOrderDTO.specId)?? && queryOrderDTO.specId == spec.categoryId>
                                        selected
                                    </#if>
                                > ${spec.categoryName}
                                </option>
                            </#list>
                        </select>
                    </div>
                </div>
                <div class="form-group col-xs-6 col-sm-1 submit-search" >
                    <button type="button" class="btn btn-block btn-blue search-submit" id="search" onclick="_search()">查询</button>
                </div>
                    <div class="form-group col-xs-6 col-sm-1 " >
                            <button type="button" class="btn btn-block btn-blue search-submit" id="output" onclick="excel()">导出</button>
                    </div>

                </form>

            </div>
        </div>

        <div class="row clearfix">
                <div class="col-md-12 column">
                    <table class="table table-bordered table-condensed">
                        <thead>
                        <tr>
                            <th>订单id</th>
                            <th>姓名</th>
                            <th>手机号</th>
                            <th>地址</th>
                            <th>费用</th>
                            <th>学校</th>
                            <th>取件信息</th>
                            <th>取件点</th>
                            <th>备注</th>
                            <th>规格</th>
                            <th>订单状态</th>
                            <th>创建时间</th>

                        </tr>
                        </thead>
                        <tbody>

                        <#list orderDTOPage.content as orderDTO>
                        <tr>
                            <td>${orderDTO.orderId}</td>
                            <td>${orderDTO.buyerName}</td>
                            <td>${orderDTO.buyerPhone}</td>
                            <td>${orderDTO.buyerAddress}</td>
                            <td>${orderDTO.orderAmount}</td>
                            <td>${orderDTO.ascriptionId}</td>
                            <td>${(orderDTO.additionalInfo)!''}</td>
                            <td>${orderDTO.pickUpPartsName}</td>
                            <td>${(orderDTO.remarks)!''}</td>
                            <td>${(orderDTO.specName)!''}</td>
                            <td>${orderDTO.getOrderStatusEnum().message}</td>
                            <td>${orderDTO.createTime}</td>

                        </tr>
                        </#list>
                        </tbody>
                    </table>
                </div>

            <#--分页-->
                <div class="col-md-12 column">
                    <ul class="pagination pull-right">
                    <#if currentPage lte 1>
                        <li class="disabled"><a href="#">上一页</a></li>
                    <#else>
                        <li><a href="/order/list?page=${currentPage - 1}&size=${size}">上一页</a></li>
                    </#if>

                    <#list 1..orderDTOPage.getTotalPages() as index>
                        <#if currentPage == index>
                            <li class="disabled"><a href="#">${index}</a></li>
                        <#else>
                            <li><a href="/order/list?page=${index}&size=${size}">${index}</a></li>
                        </#if>
                    </#list>

                    <#if currentPage gte orderDTOPage.getTotalPages()>
                        <li class="disabled"><a href="#">下一页</a></li>
                    <#else>
                        <li><a href="/order/list?page=${currentPage + 1}&size=${size}">下一页</a></li>
                    </#if>
                    </ul>
                </div>
            </div>
        </div>
    </div>

</div>



<script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script src="/jedate/jquery.jedate.min.js"></script>
<script>
    //下单时间
    var start =	{
        //isinitVal:true,
        festival:false,
        format:"YYYY-MM-DD",
        zIndex:30000,
        onClose:false,
        okfun:function(e) {
        }
    }
    $("#startTime").jeDate(start);
    $("#output").click(function () {

    });


    function excel() {
        document.getElementById('sendForm').action ="/order/export";
        document.getElementById("sendForm").submit();
    }

    function _search() {
        // document.getElementById('sendForm').action="/order/list";
        // document.getElementById("sendForm").submit();

        $("#sendForm").attr("action","/order/list");
        $("#sendForm").submit()
    }


</script>


</body>
</html>